package com.feini.ktv.svc.controller.om;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.feini.ktv.svc.entity.om.OmOrderLineH;
import com.feini.ktv.svc.service.om.IOmOrderLineHService;
import com.podara.skeleton.controller.SkeletonController;
import com.podara.skeleton.log.annotation.LogLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jiangzr
 * @since 2021-04-15
 */
@LogLogger
@RestController
public class OmOrderLineHController implements SkeletonController {
    @Autowired
    private IOmOrderLineHService orderLineHService;

    @GetMapping("/queryOrderLineHList")
    public List<OmOrderLineH> queryOrderLineHList() {
        QueryWrapper<OmOrderLineH> orderLineQuery = new QueryWrapper<OmOrderLineH>();
        orderLineQuery.eq("order_status", "0");
        List<OmOrderLineH> omOrderLines = this.orderLineHService.list(orderLineQuery);
        return omOrderLines;
    }

    @GetMapping("/queryOrderLineHById/{orderId}")
    public List<OmOrderLineH> queryOrderLineHById(@PathVariable("orderId") String orderId) {
        QueryWrapper<OmOrderLineH> orderLineQuery = new QueryWrapper<OmOrderLineH>();
        orderLineQuery.eq("order_status", "0");
        orderLineQuery.eq("order_id", orderId);
        List<OmOrderLineH> omOrderLines = this.orderLineHService.list(orderLineQuery);
        return omOrderLines;
    }
}

